﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MinecraftProtocol.GameState
{
    public class Point3D
    {
        public int X { get; set; }
        public int Y { get; set; }
        public int Z { get; set; }

        public Point3D(int x, int y, int z)
        {
            X = x;
            Y = y;
            Z = z;
        }

        public Point3D()
        {
        }

        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            if (obj.GetType().Equals(this.GetType()))
            {
                Point3D other = (Point3D)obj;
                return ((other.X == this.X) && (other.Y == this.Y) && (other.Z == this.Z));
            }
            else
            {
                return false;
            }
        }

        public override int GetHashCode()
        {
            const int MaxSize = 32000;

            return (Z * MaxSize * MaxSize) + (Y * MaxSize) + X;
        }

    }
}
